/*
 * @lc app=leetcode.cn id=217 lang=rust
 *
 * [217] 存在重复元素
 */

// @lc code=start
impl Solution {
    pub fn contains_duplicate(nums: Vec<i32>) -> bool {
        if(nums.len() <= 1) {
            return false;
        }
        use std::collections::HashMap;
        let mut map = HashMap::new();
        for elem in &nums {
            if(map.contains_key(&elem)) {
                return true;
            }
            map.insert(elem, 0);
        }
        return false;
    }
}
// @lc code=end

